package com.dljd.javase.t12.selltickets;

import java.util.Random;

public class SellWindowThread extends Thread {
    private String name;
    private Ticket  ts;
    public SellWindowThread(String name, Ticket  ts){
        super(name);
        this.name=name;
        this.ts=ts;
    }

    @Override
    public void run() {
        while(ts.hasTickets()){
//            try {
//                Thread.sleep(new Random().nextInt(3)*1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
            ts.sellTicket(name);
            System.out.println("aaa");
        }
    }
}
